<?php

if (!defined("EXPONENT")) exit("");

if (exponent_permissions_check("manage",$loc)) {
	
	$action_a = $db->selectObject("album","location_data='".serialize($loc)."' AND rank=".$_GET['a']);
	$action_b = $db->selectObject("album","location_data='".serialize($loc)."' AND rank=".$_GET['b']);
	
	$action_a->rank = $_GET['b'];
	$action_b->rank = $_GET['a'];
	
	$db->updateObject($action_a,"album");
	$db->updateObject($action_b,"album"); 
	
	exponent_flow_redirect();
} else {
	echo SITE_403_HTML;
}

?>